package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.wx.WxFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author jzp
 * @since 2022/11/22 20:27
 */
@RestController
@RequestMapping("/wx/footprint/")
public class WxFootprint {
    @Autowired
    WxFootprintService wxFootprintService;

    @RequestMapping("list")
    public BaseRespVo list(Integer page, Integer limit) {
        CommonData commonData = wxFootprintService.list(page, limit);
        return BaseRespVo.succeed(commonData);
    }

    @RequestMapping("delete")
    public BaseRespVo delete(@RequestBody Map map) {
        Integer id = (Integer) map.get("id");
        int num = wxFootprintService.delete(id);
        return BaseRespVo.succeed();
    }
}
